/* QtLua -- Lua bindings for Qt
   Copyright (C) 2011, Jarek Pelczar

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General
   Public License along with this library; if not, write to the
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301 USA

*/

#include "qluadebuggeragent_p.h"
#include "qluascriptdebugger_p.h"

QLuaDebuggerAgent::QLuaDebuggerAgent(QLuaScriptDebugger *parent, QLuaScriptEngine * engine) :
    QObject(parent),
    QLuaScriptEngineAgent(engine),
    m_debugger(parent)
{
}

QLuaDebuggerAgent::~QLuaDebuggerAgent()
{

}

void QLuaDebuggerAgent::contextPop()
{
    emit _p_contextPop();
}

void QLuaDebuggerAgent::contextPush()
{
    emit _p_contextPush();
}

void QLuaDebuggerAgent::exceptionCatch(qint64 scriptId, const QLuaScriptValue& exception)
{
    emit _p_exceptionCatch(scriptId, exception);
}

void QLuaDebuggerAgent::exceptionThrow(qint64 scriptId, const QLuaScriptValue& exception, bool hasHandler)
{
    emit _p_exceptionThrow(scriptId, exception, hasHandler);
}

void QLuaDebuggerAgent::functionEntry(qint64 scriptId)
{
    emit _p_functionEntry(scriptId);
}

void QLuaDebuggerAgent::functionExit(qint64 scriptId, const QLuaScriptValue & returnValue)
{
    emit _p_functionExit(scriptId, returnValue);
}

void QLuaDebuggerAgent::positionChange(qint64 scriptId, int lineNumber, int columnNumber)
{
    emit _p_positionChange(scriptId, lineNumber, columnNumber);
}

void QLuaDebuggerAgent::scriptLoad(qint64 id, const QString & program, const QString& fileName, int baseLineNumber)
{
    emit _p_scriptLoad(id, program, fileName, baseLineNumber);
}

void QLuaDebuggerAgent::scriptUnload(qint64 id)
{
    emit _p_scriptUnload(id);
}
